import request from '@/utils/httpRequest'

// 结算单列表
export function getSettleBillList(param) {
  return  request({
    url: `/pop/settlement/back_list`,
    method: 'get',
    params: param || {}
  })
}

//结算单详情
export function settleDetail(data = {}) {
  return request({
    url: '/pop/settlement/detail',
    method: 'get',
    params: { ...data }
  })
}

//本期订单明细
export function settleOrderList(data = {}) {
  return request({
    url: '/pop/settlement/detail/list',
    method: 'get',
    params: { ...data }
  })
}

//上期复核明细
export function lastReviewList(data = {}) {
  return request({
    url: '/pop/settlement/detail/review_list',
    method: 'get',
    params: { ...data }
  })
}

//付款单列表
export function getPaymentList(data = {}) {
  return request({
    url: '/pop/payment/list',
    method: 'get',
    params: { ...data }
  })
}

//付款申请前置信息
export function paymentBase(data = {}) {
  return request({
    url: '/pop/payment/base_info',
    method: 'get',
    params: { ...data }
  })
}

//复核列表
export function getReviewList(data = {}) {
  return request({
    url: '/pop/settlement/review/list',
    method: 'get',
    params: { ...data }
  })
}

//复核详情
export function settleReviewDetail(data = {}) {
  return request({
    url: '/pop/settlement/review/detail',
    method: 'post',
    params: { ...data }
  })
}

//账单推送
export function pushBill(data = {}) {
  return request({
    url: '/pop/settlement/push_bill',
    method: 'post',
    data: { ...data }
  })
}

//调整金额
export function adjustAmout(data = {}) {
  return request({
    url: '/pop/settlement/adjust',
    method: 'post',
    params: { ...data }
  })
}

export function importAdjustAmount(data = {}) {
  return request({
    url: '/pop/settlement/export/adjust',
    method: 'post',
    responseType: 'blob',
    data
  })
}

export function exportBill(data = {}) {
  return request({
    url: '/pop/settlement/back_list/export',
    method: 'post',
    responseType: 'blob',
    data: { ...data }
  })
}

export function exportPaymentBill(data = {}) {
  return request({
    url: '/pop/payment/list/export',
    method: 'post',
    responseType: 'blob',
    data: { ...data }
  })
}

export function exportReviewBill(data = {}) {
  return request({
    url: '/pop/settlement/review/list/export',
    method: 'post',
    responseType: 'blob',
    data: { ...data }
  })
}